package com.cn.why.film.filmindex.repository;

import com.cn.why.film.filmindex.entity.IndexTitle;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface PetIndexRepository extends JpaRepository<IndexTitle,Integer> {
    //模糊查询
    @Query(value = "select a from indextitle a where concat(a.petname,a.title,a.texts)like '%?1%'",nativeQuery = true)
    List<IndexTitle> findByPetName(String text);
}
